<?php

class Module_Impl_Tag_Opration extends Module_Impl_Abstarct_Opration  {
	
	const FAIL_TO_UPDATE_BECAUSE_NO_EXIST = 'blog.tag.update.fail.no.exist';
	const FAIL_TO_DELETE_BECAUSE_NO_EXIST = 'blog.tag.delete.fail.no.exist';
	
	protected $_tablename = Config_Table::TABLE_BLOG_TAG;	
	protected $_objectname = "Object_Blog_Tag";
	
	protected function __construct() {
		parent::__construct ();	
		$this->_check_field_before_insert['user_id&name']= 'blog.tag.new.fail.exist';
			
		$this->_magic_field_count['user_id']['table'] = Config_Table::TABLE_USER;
		$this->_magic_field_count['user_id']['field'] = 'tags_count';
		$this->_magic_field_count['user_id']['step'] = 1;	

		$this->_interface_select = Module_Impl_Tag_Select::getInstance();
	}
	
	/**
	 * Singleton instance
	 * @var Module_Impl_Tag_Opration
	 */
	protected static $_instance = null;
	/**
	 * Singleton instance 
	 * @return Module_Impl_Tag_Opration
	 */
	public static function getInstance() {
		if (null === self::$_instance) {
			self::$_instance = new self ( );
		}
		return self::$_instance;
	}		
}